package com.ysstech.kettle.entity;

import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 转换执行记录表
 * </p>
 *
 * @author lishuangliang
 * @since 2021-06-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("kettle_job_record")
public class JobRecord extends Model<JobRecord> {

    private static final long serialVersionUID = 1L;
    @TableField("ID")
    private String id;
    /**
     * 转换ID
     */
    @TableField("RECORD_TRANS_ID")
    private String recordTransId;

    /**
     * 启动时间
     */
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    @TableField("START_TIME")
    private LocalDateTime startTime;

    /**
     * 停止时间
     */
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    @TableField("STOP_TIME")
    private LocalDateTime stopTime;
    /**
     * 转换日志记录文件保存位置
     */
    @TableField("LOG_FILE")
    private String logFile;

    /**
     * 分类ID
     */
    @TableField("JOB_ID")
    private String jobId;
    /**
     * 执行时间
     */
    @TableField("DURATION")
    private long duration;

    /**
     * 执行条数
     */
    @TableField("ROWCOUNT")
    private BigDecimal rowcount;

    /**
     * 执行类型 1.作业任务，2明细作业任务
     */
    @TableField("FTYPE")
    private Integer ftype;

    /**
     * 状态 1 成功 2失败 3执行中
     */
    @TableField("STATUS")
    private Integer status;
    /**
     * 添加时间
     */
    @TableField("ADD_TIME")
    private LocalDateTime addTime;

    /**
     * 添加用户
     */
    @TableField("ADD_USER")
    private String addUser;

    /**
     * 修改时间
     */
    @TableField("EDIT_TIME")
    private LocalDateTime editTime;

    /**
     * 修改用户
     */
    @TableField("EDIT_USER")
    private String editUser;
    /**
     * 删除原因
     */
    @TableField("DELETE_REASON")
    private String deleteReason;


    @TableField(exist = false)
    private String selFtype;
    @TableField(exist = false)
    private String jobName;

    @Override
    protected Serializable pkVal() {
        return null;
    }

}
